package com.ailot.cloud.upms.common.dto;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class TreeNode {
    protected String id;
    protected String parentId;
    protected List<TreeNode> children = new ArrayList<>();
    private Integer sort;

    public void addChildren(TreeNode treeNode) {
        children.add(treeNode);
    }

    public List<TreeNode> getChildren() {
        if (children.size() == 0) {
            return null;
        }
        return children;
    }
}
